package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsOrderGoodsMapper;
import com.qf.pojo.DtsOrderGoods;
import com.qf.service.DtsOrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ZhangYuJie
 * projectName:shop_manage
 * time:2022/5/17 21:24
 * description:
 */
@Service
public class DtsOrderGoodsServiceImpl implements DtsOrderGoodsService {
    @Autowired
    private DtsOrderGoodsMapper orderGoodsMapper;

    @Override
    public boolean checkExist(Integer goodsId) {
        QueryWrapper<DtsOrderGoods> wapper = new QueryWrapper<>();
        wapper.eq("deleted", false);
        wapper.eq("goods_id", goodsId);
        long count = orderGoodsMapper.selectCount(wapper);
        return count != 0;
    }
}
